import time

from Base.Base import Base
from selenium.webdriver.common.by import By
class Page(Base):
    # 登录
    login_loc=(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a')
    # 用户名
    username_loc=(By.NAME,'username')
    # 密码
    password_loc=(By.NAME,'password')
    # 登录按钮
    loginbtn_loc=(By.CLASS_NAME,'finish-btn')
    # 输入框输入

    def login(self):
        self.find_element(self.login_loc).click()

    def username(self,user):
        self.find_element(self.username_loc).send_keys(user)

    def password(self,word):
        self.find_element(self.password_loc).send_keys(word)

    def loginbtn(self):
        self.find_element(self.loginbtn_loc).click()

    def a3mall_luoji(self,user,word):
        self.open_url('http://10.59.9.14:7003/')
        self.login()
        self.username(user)
        self.password(word)
        # 强制等待
        time.sleep(10)
        self.loginbtn()









